<!doctype html>
<html ng-app="myApp">
<head>
  <link rel="stylesheet" href="http://cdn.jsdelivr.net/foundation/4.3.2/css/foundation.min.css">
  <script src="js/angular.js"></script>
  <style>
    .odd {
      background-color: #3ff;
    }
    .even {
      background-color: red;
    }
    input[type="text"].myFocus {
		border-color: deepskyblue;
		}
		input[type="text"].myBlur {
		border-color: red;
	
	}
  </style>
</head>
<body>
<!--
	作者：779744514@qq.com
	时间：2015-08-20
	描述：javascript 中数组从0下标开始，所以使用！even和！odd将even（偶数）和odd（奇数）反转  even: !$even, odd: !$odd,
-->
  <ul ng-controller="PeopleController">
    <li ng-repeat="(key,value) in people" ng-init="focus=false;blur=false;" >
    	<label>{{$index}}</label>
      <input type="text"name="value.name"ng-class="{myFocus:focus, myBlur:blur}" ng-blur="blur=true;" ng-focus="focus=true;"/>{{value.name}} lives in {{value.city}}
    </li>
  </ul>
<code>{{ equation }}</code>
  <script>
    angular.module('myApp', [])
    .controller('PeopleController', function($scope) {
      $scope.people = [
        {name: "Ari", city: "San Francisco"},
        {name: "Erik", city: "Seattle"}
      ];
      var aa=0;
      $scope.change=function(value,$event){
 console.log(value.name);
      	console.log($event);
     
      }
   });
  </script>

</body>
</html>